﻿namespace C12_Ex02_Shaked_032675316_Itay_032511057
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using FacebookWrapper;
    using FacebookWrapper.ObjectModel;
    
    public static class FacebookWrapperExtender
    {
        public static List<string> GetPicturesList(this User i_User)
        {
            List<string> picturesList = new List<string>();
            foreach (Album album in i_User.Albums)
            {
                foreach (Photo photo in album.Photos)
                {
                    picturesList.Add(photo.URL);
                }
            }

            return picturesList;
        }

        public static User GetFriendById(this User i_User, string i_FriendId)
        {
            User friend = null;

            foreach (User user in i_User.Friends)
            {
                if (user.Id == i_FriendId)
                {
                    friend = user;
                    break;
                }
            }

            return friend;
        }
    }
}
